import { applyMiddleware, legacy_createStore } from "redux";
import thunk from "redux-thunk";
import logger from "redux-logger"
import {ALLSTATETYPE,ALLACTIONTYPE,SETLIST} from "../type/store.d"
const initialState = {
list:[]
}

const render= (state:ALLSTATETYPE = initialState, { type, payload }:ALLACTIONTYPE) => {
  switch (type) {

    case SETLIST:
      state.list=payload
    return { ...state}

  default:
    return state
  }
}
const store = legacy_createStore(render, applyMiddleware(thunk, logger))
export default store
